	var table_count = new Array()
	var count = 0;
	var cnt   = 2;
	var caCnt=0;
	
	function doDelete(){
		var jojung_check = document.revise_frm.jojung_check;
		var check_cnt = 0;
		var idx;
		var nyeondo;
		var suji_gb;
		var hwoigye_gb;
		var buseo;
		var yesan_cd;
		var chasu;
		var sangtai;

		if(jojung_check.length > 1){
			for(i=0 ; i<jojung_check.length; i++) {
				if(jojung_check[i].checked == true) {
					nyeondo = document.revise_frm.nyeondo[i].value;
					suji_gb = document.revise_frm.suji_gb[i].value;
					hwoigye_gb = document.revise_frm.hwoigye_gb[i].value;
					buseo = document.revise_frm.buseo[i].value;
					yesan_cd = document.revise_frm.yesan_cd[i].value;
					chasu = document.revise_frm.chasu[i].value;
					sangtai = document.revise_frm.sangtai[i].value;
					
					if(suji_gb == "수입"){
						suji_gb = "1";
					}else{
						suji_gb = "2";
					}
					if(hwoigye_gb == "법인회계"){
						hwoigye_gb = "1";
					}else{
						hwoigye_gb = "2";
					}	
					check_cnt++;
				}
			}
		}else{
			if(jojung_check.checked == true) {
				nyeondo = document.revise_frm.nyeondo.value;
				suji_gb = document.revise_frm.suji_gb.value;
				hwoigye_gb = document.revise_frm.hwoigye_gb.value;
				buseo = document.revise_frm.buseo.value;
				yesan_cd = document.revise_frm.yesan_cd.value;
				chasu = document.revise_frm.chasu.value;
				sangtai = document.revise_frm.sangtai.value;
			}
		}
		
		if(check_cnt==0){
			alert("삭제할 항목을 하나이상 선택하세요.");
			return false;
		}
		if(confirm("선택한 예산정보를 삭제 하시겠습니까?")){
			location.href = "delete_revise.action?nyeondo="+nyeondo+"&suji_gb="+suji_gb+"&hwoigye_gb="+hwoigye_gb+"&buseo="+buseo+"&yesan_cd="+yesan_cd+"&chasu="+chasu+"&sangtai="+sangtai;
		}
		
	}
	
	function goModify(obj){
	//function goModify(nyeondo, suji_gb, hwoigye_gb, buseo, yesan_cd, chasu, sangtai){
		var jojung_check = document.revise_frm.jojung_check;
		var check_cnt = 0;
		var idx;
		var tmp = obj.split(",");
		var nyeondo = tmp[0];
		var suji_gb = tmp[1];
		var hwoigye_gb = tmp[2];
		var buseo = tmp[3];
		var yesan_cd = tmp[4];
		var chasu = tmp[5];
		var sangtai = tmp[6];
	
		alert(obj);
//		alert("년도 : "+nyeondo);
//		alert("수지 : "+suji_gb);
//		alert("회계 : "+hwoigye_gb);
//		alert("부서 : "+buseo);
//		alert("예산 : "+yesan_cd);
//		alert("차수 : "+chasu);
//		alert("상태 : "+sangtai);
		
		width = 850;
		height = 530;
		scrollOption = "Yes";
		var url = "modify_revise.action?nyeondo="+nyeondo+"&suji_gb="+suji_gb+"&hwoigye_gb="+hwoigye_gb+"&buseo="+buseo+"&yesan_cd="+yesan_cd+"&chasu="+chasu+"&sangtai="+sangtai;
		window.open(url, "popup_page",	"left="	+ 130 + ",top=" + 100	+ ",width="	+ width + ",height=" + height	+ ",ScrollBars="+scrollOption+",status=yes,menubar=no,toolbar=no");

	}
	
	function addRow_add(TableID){
		count++;
		cnt++;
		table_count[cnt] = count;
	
		var tbody = document.getElementById(TableID).getElementsByTagName("TBODY")[0];
		var row   = document.createElement("TR");
		caCnt = tbody.rows.length-1;
		alert(caCnt);
	
		if(TableID == "jojong"){
			var td1   = document.createElement("TD");
			td1body = "<input type='checkbox' name='check_mod'>";
			td1.insertAdjacentHTML('beforeEnd', td1body );
		}
		if(TableID == "jojong"){
			var td2   = document.createElement("TD");
			td2body = "<input type='text' name='geungeo'>";
			td2.insertAdjacentHTML('beforeEnd', td2body );
		}
		if(TableID == "jojong"){
			var td3   = document.createElement("TD");
			td3body = "<input type='text' name='so_money'>";
			td3.insertAdjacentHTML('beforeEnd', td3body );
		}
		if(TableID == "jojong"){
			var td4   = document.createElement("TD");
			td4body = "<input type='text' name='byeondong'>";
			td4.insertAdjacentHTML('beforeEnd', td4body );
		}
		if(TableID == "jojong"){
			var td5   = document.createElement("TD");
			td5body = "<input type='text' name='jojong_money'>";
			td5.insertAdjacentHTML('beforeEnd', td5body );
		}
		
		
		//row.height="30px";
		//row.style.padding ="0px 3px 0px 10px";
	
	    row.appendChild(td1);
		row.appendChild(td2);
    	row.appendChild(td3);
    	row.appendChild(td4);
    	row.appendChild(td5);    	
    	
		tbody.appendChild(row);
		
	}
	
	function delRow_del(TableID){
		var check_mod = document.getElementsByName('check_mod');
		if(TableID == "jojong"){
			if(!check_mod){
				alert("삭제할 항목을 선택하세요.");
				return;
			}else{
				var tbody = document.getElementById(TableID).getElementsByTagName("TBODY")[0];
				tbody.deleteRow(tbody.rows.length-1);
				
			}
		}
	}

	function onlyNumber(){
   		if((event.keyCode<48)||(event.keyCode>57))
      	event.returnValue=false;
      	
      	var jojong = document.modi_form.jojong_money;
      	
      	for(i=0; i<jojong.length; i++){
      		
      		//var sum += jojong[i].value;
      		//alert(sum);
      	}
      	alert(jojong.value);
	}
	
	function selectAll(form){
		try {
			if(document.form.all.checked)	{
				for(i=0; i<list.document.form.jojung_check.length; i++)		list.document.form.jojung_check[i].checked=true;
			}else{	
				for(i=0; i<list.document.form.jojung_check.length; i++)		list.document.form.jojung_check[i].checked=false;
			}
		} catch(exception) {
			alert("체크할 데이타가 없습니다");
		}
	}	

	
	